Skip to content

[AIBE6/1팀/김정환] TODO APP 만들기 완료#61

Closed
kjh3165 wants to merge 23 commits intosik2:mainfrom
kjh3165:todoapp
Closed

[AIBE6/1팀/김정환] TODO APP 만들기 완료#61
kjh3165 wants to merge 23 commits intosik2:mainfrom
kjh3165:todoapp

Conversation

@kjh3165
Copy link

@kjh3165 kjh3165 commented Mar 19, 2026

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 할일 추가, 삭제, 완료 기능을 제공하며 localStorage를 통해 데이터를 영속적으로 저장하는 React 기반의 Todo 애플리케이션을 완성합니다. 개발 환경은 Vite, ESLint, Prettier로 설정되었으며, 명확한 컴포넌트 구조를 통해 코드의 가독성과 관리 용이성을 확보했습니다.

Highlights

  • Todo 앱 기능 구현: 할일 추가, 삭제, 완료(체크) 기능을 갖춘 React 기반의 Todo 애플리케이션이 구현되었습니다.
  • 데이터 영속성: 사용자의 할일 목록이 브라우저의 localStorage에 저장되어 페이지를 새로고침해도 데이터가 유지됩니다.
  • 개발 환경 설정: Vite를 사용하여 프로젝트를 초기화하고, ESLint와 Prettier를 도입하여 코드 품질 및 일관성을 관리하도록 설정했습니다.
  • 컴포넌트 구조화: TodoItem, TodoList, TodoWriteForm 등 기능별로 컴포넌트를 분리하여 재사용성과 유지보수성을 높였습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 React를 사용하여 Todo 애플리케이션을 성공적으로 구현했습니다. 코드는 커스텀 훅과 분리된 컴포넌트로 잘 구조화되어 있어 유지보수성이 좋습니다. 안정성, 모범 사례 및 사용자 경험과 관련하여 몇 가지 개선 영역을 확인했습니다. 자세한 의견은 아래를 참조해주세요.

Comment on lines +7 to +11
export const getItem = (key, defaultValue) => {
const value = storage.getItem(key)
if (value == null) return defaultValue
return JSON.parse(value)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

JSON.parse(value) 호출은 localStorage의 데이터가 손상되었거나 유효한 JSON 형식이 아닐 경우 오류를 발생시켜 전체 애플리케이션을 중단시킬 수 있습니다. try...catch 블록으로 감싸고 파싱에 실패할 경우 defaultValue를 반환하도록 하여 안정성을 높이는 것이 좋습니다.

Suggested change
export const getItem = (key, defaultValue) => {
const value = storage.getItem(key)
if (value == null) return defaultValue
return JSON.parse(value)
}
export const getItem = (key, defaultValue) => {
const value = storage.getItem(key)
if (value === null) {
return defaultValue
}
try {
return JSON.parse(value)
} catch (error) {
console.error(`localStorage에서 키 "${key}"에 대한 JSON 파싱 중 오류 발생:`, error)
return defaultValue
}
}

return (
<li style={{ textDecorationLine: todo.checked ? 'line-through' : 'none' }}>
<input className="check-box" type="checkbox" onChange={() => toggleTodo(todo.id)} checked={todo.checked} />
{todo.id} : {todo.text}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 Todo 항목에 ID가 표시되고 있습니다 ({todo.id} :). 이는 디버깅 목적으로 사용된 것으로 보입니다. 더 깔끔한 사용자 인터페이스를 위해 이 부분을 제거하는 것이 좋습니다.

Suggested change
{todo.id} : {todo.text}
{todo.text}

const handleSubmit = (e) => {
e.preventDefault()
const form = e.target
if (form.todo.value == '') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 유효성 검사는 입력값이 빈 문자열인지 확인하지만, 공백으로만 구성된 todo를 제출하는 것을 허용합니다. 값을 확인하기 전에 trim()을 사용하여 양쪽 공백을 제거하는 것이 좋습니다. 또한, == 대신 엄격한 동등 연산자 ===를 사용하는 것이 권장됩니다.

Suggested change
if (form.todo.value == '') {
if (form.todo.value.trim() === '') {

e.preventDefault()
const form = e.target
if (form.todo.value == '') {
alert('할일을 입력해주세요')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

유효성 검사에 alert()를 사용하면 UI가 차단되어 사용자에게 불편을 줄 수 있습니다. 더 나은 접근 방식은 입력 필드 근처에 인라인 오류 메시지를 표시하는 것입니다. 이를 위해서는 오류 메시지를 관리하기 위한 상태를 컴포넌트에 추가해야 합니다.

Comment on lines +24 to +30
const removeTodo = (id) => {
setTodos(todos.filter((todo) => todo.id != id))
}

const toggleTodo = (id) => {
setTodos(todos.map((todo) => (todo.id != id ? todo : { ...todo, checked: !todo.checked })))
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

removeTodotoggleTodo 함수에서 != 연산자를 사용하고 있습니다. 자바스크립트에서는 예기치 않은 타입 강제 변환을 피하기 위해 엄격한 (불)일치 연산자인 ===!==를 사용하는 것이 모범 사례입니다.

Suggested change
const removeTodo = (id) => {
setTodos(todos.filter((todo) => todo.id != id))
}
const toggleTodo = (id) => {
setTodos(todos.map((todo) => (todo.id != id ? todo : { ...todo, checked: !todo.checked })))
}
const removeTodo = (id) => {
setTodos(todos.filter((todo) => todo.id !== id))
}
const toggleTodo = (id) => {
setTodos(todos.map((todo) => (todo.id !== id ? todo : { ...todo, checked: !todo.checked })))
}

@kjh3165 kjh3165 closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant